<div class="pageFormContent" data-layout-h="0">
    <table data-toggle="tablefixed" data-width="100%" data-nowrap="true">
        <thead>
        <tr>
            <th width="50">No.</th>
            <th>代理名</th>
            <th>ip</th>
            <th width="100">状态</th>
        </tr>
        </thead>
        <tbody>
        <#list agentStates as row>
        <tr data-id="${(row.id)!}">
            <td>${(row_index+1)!}</td>
            <td title="${(row.name)!}">${(row.name)!}</td>
            <td title="${(row.ip)!}">${(row.ip)!}</td>
            <td style="background-color:<#if row.state>greenyellow<#else>silver</#if>"></td>
            <#--<td><#if row.state>正常<#else>异常</#if></td>-->
        </tr>
        </#list>
        </tbody>
    </table>
</div>

<script>

    $(function(){
        refreshMonitorDiv();
    });

    function refreshMonitorDiv()
    {
        if(monitorIntervId==null)//新进入board页面时
        {
            monitorIntervId = setInterval(refreshAgentMonitorDiv, 5000);
        }
        else
        {
            clearInterval(monitorIntervId);
            monitorIntervId = setInterval(refreshAgentMonitorDiv, 5000);
        }
    }

    function refreshAgentMonitorDiv()
    {
        if($('#agentMonitorDiv').length==0)//离开board页面
        {
            clearInterval(monitorIntervId);
            return;
        }

        $('#agentMonitorDiv').bjuiajax('refreshLayout', {target:'#agentMonitorDiv',loadingmask:false})

    }
</script>
